package sun.superstring.operator;

public class OperatorDemo1 {
    public static void main(String[] args) {

        // 目标：搞清楚基本的算术运算符
        demo1();
        System.out.println("-----------------------");
        demo2();

    }
    public static void demo1(){
        // 目标：搞清楚基本的算术运算符
        int a = 10;
        int b = 3;
        System.out.println(a + b);
        System.out.println(a - b);
        System.out.println(a * b);
        System.out.println(a / b); // 3.33333...   ==> 3
        System.out.println((double)a / b);  // 10.0 / 3.0 = 3.33333...
        System.out.println(a % b);
    }

    // 需求：研究+符号作连接符还是做运算
    public static void demo2(){
        int a= 5;
        System.out.println("abc" + a); // abc5
        System.out.println(a + 5);  // 10
        System.out.println("hello" + a + 'a');  // hello5a
        System.out.println(a + 'a' + "hello");  // 102hello
    }
}
